<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>昭通市中小企业</title>
</head>

<body>
</body>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/config.js"></script>
<script>
  $(function() {
    var accessToken = window.localStorage.getItem("backstage-access-token");
    if (window.localStorage.getItem("backstage-access-permissionList")) {
      var accessToken = window.localStorage.getItem("backstage-access-token");
      var error = function(data) {
        window.location.href = site.interUrl + "login.html";
      };
      var ss_menus = JSON.parse(window.localStorage.getItem("backstage-access-permissionList"));
      var groups = $.grep(ss_menus, function(c) {
        return c.level == 1;
      });
      var gid = groups[0].id;
      var url = groups[0].url;
      var subid = '';
      var menuid = '';
      var subs = $.grep(ss_menus, function(c) {
        return c.parentId == gid;
      });
      var u = url.match(/\{\{(.+?)\}\}/g);
      if (u != "" && u != undefined) {
        var um = u.toString();
        var up = um.substring(2, um.length - 2);
        var uu = site[up];
        url = url.replace(um, uu);
      }

      if (subid) {
        window.location.href = url + "?groupid=" + gid + "&subid=" + subid + "&menuid=" + menuid;
      } else {
        window.location.href = url + "?groupid=" + gid;
      }
    } else {
      window.location.href = site.interUrl + "login.html";
    }
  });
</script>